<h2 class="title">Liste der Schwierigkeitsgrade</h2>

<%= link_to 'Neuer Grad', new_grade_path if @user.is_schorsch? %>
<div class="content"> <!-- Content start -->
<table>
  <tr>
    <th>Grad</th>
    <th>Anzahl Routen</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @grades.each do |grade| %>
  <tr>
    <td><%= grade.grade %></td>
    <td><%= grade.routes.size %></td>
    <td><%= link_to 'Anzeigen', grade %></td>
    <td><%= link_to 'Editieren', edit_grade_path(grade) if @user.is_schorsch?%></td>
    <td><%= link_to 'Loeschen', grade, :confirm => 'Are you sure?', :method => :delete if @user.is_schorsch? %></td>
  </tr>
<% end %>
</table>

<br />

</div>
